#ifndef WLAN_DETECT_H
#define WLAN_DETECT_H

#include <windows.h>
#include <wlanapi.h>
#include <string>
#include <vector>
#include "../common_utils/mlcc_common.h"
#include "../file/fileofconfig.h"

class WlanDetect {
public:
    WlanDetect();
    ~WlanDetect();

    std::vector<std::string> EnumerateNetworks(const std::wstring& prefix);
    bool connect_wlan_byssid(const std::string& ssid, const std::string& password);
	std::vector<std::string> tmp_SSID;
    std::vector< wlan_ssid_password> wsp; 
    bool disconnect_wlan();
    void prompt_and_disconnect();
private:
   
    HANDLE hClient;
    std::vector<std::string> FilterNetworksByPrefix(PWLAN_AVAILABLE_NETWORK_LIST pBssList, const std::wstring& prefix) const;
    std::wstring generate_wlan_profile_xml(const std::wstring& ssid, const std::wstring& password);
    GUID get_first_wlan_interface_guid();
    void handle_wlan_error(const std::string& context, DWORD error_code);
    std::wstring escape_xml(const std::wstring& input);
};

#endif // WLAN_DETECT_H
